<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../yl/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <title>数据表配置</title>
    <style>
        .el-switch{
            border: 1px solid #dcdfe6;
            height: 31.98px;
            border-radius: 4px;
            padding: 0 10px;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <div>
                <el-input v-model="form.Data" @change="check" style="width: 200px; margin-right: 10px;" placeholder="请输入表名/备注" clearable></el-input>
                <el-switch v-model="form.isCommentNull" style="margin-right: 10px;" @change="check" active-value="1" inactive-value="0" active-text="仅查未备注表" inactive-text=""></el-switch>
                <el-switch v-model="form.keepState" style="margin-right: 10px;" @change="check" active-value="1" inactive-value="0" active-text="开启记忆查询" inactive-text=""></el-switch>
                <el-button icon="Refresh" style="margin: 0; margin-right: 10px;" @click="reset">重置</el-button>
            </div>
        </div>
        <div class="body">
            <div class="right">
                <el-table id="table" height="450" v-loading="loading" ref="multipleTable" tooltip-effect="dark" border :data="tableData">
                    <el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
                    <el-table-column prop="TABLE_NAME" show-overflow-tooltip label="表名" min-width="250"></el-table-column>
                    <el-table-column prop="TABLE_COMMENT" label="表备注" min-width="250">
                        <template v-slot="{row}">
                            <span :style="{color:row.TABLE_COMMENT?'':'#F56C6C'}">
                                {{row.TABLE_COMMENT?row.TABLE_COMMENT:'未备注'}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column label="主键自增情况" min-width="220">
                        <template v-slot="{row}">
                            <span :style="{color:row.Document_Length==''?'#E6A23C':''}">{{row.Document_Length == ''?'自定义主键':row.Document_Head + '开头自动递增,共' + row.Document_Length + '位'}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="ROW_COUNT" label="表中数据条数" min-width="140">
                        <template v-slot="{row}">
                            共{{row.ROW_COUNT}}条数据
                        </template>
                    </el-table-column>
                    <el-table-column prop="COLUMN_COUNT" label="字段总数" min-width="140">
                        <template v-slot="{row}">
                            共{{row.COLUMN_COUNT}}个字段
                        </template>
                    </el-table-column>
                    <el-table-column prop="COMMENTED_COUNT" label="备注字段数" min-width="140">
                        <template v-slot="{row}">
                            已备注{{row.COMMENTED_COUNT}}个字段
                        </template>
                    </el-table-column>
                    <el-table-column label="字段备注状态" min-width="140">
                        <template v-slot="{row}">
                            <span :style="{color:row.COLUMN_COUNT != row.COMMENTED_COUNT?'#F56C6C':'#67C23A'}">
                                {{row.COLUMN_COUNT !=
                                row.COMMENTED_COUNT?(Number(row.COLUMN_COUNT)-Number(row.COMMENTED_COUNT)) +
                                '个未备注字段':'字段已全部备注'}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column align="center" prop="CREATE_TIME" label="创建时间" min-width="180"></el-table-column>
                    <el-table-column align="center" prop="UPDATE_TIME" label="最后修改时间" min-width="180"></el-table-column>
                    <el-table-column align="center" label="操作" fixed="right" width="160">
                        <template #default="{row}">
                            <div style="display: flex; align-items: center;">
                                <el-button size="small" style="margin-right: 10px;" @click="handleEdit(row)">
                                    编辑
                                </el-button>
                                <el-dropdown trigger="click" @command="(event)=>{this[event](row)}">
                                    <el-button type="danger" size="small">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item command="handleDetail">
                                                查看详情
                                            </el-dropdown-item>
                                            <el-dropdown-item command="handleShow">
                                                查看数据
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination style="margin-top: 1%;" :current-page="form.Page" :page-size="form.Limit"
                    :page-sizes="[20, 30, 60, 100, 500]" layout="total, sizes, prev, pager, next, jumper" :total="Total"
                    @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div>
        </div>
    </div>
    </div>
    <script src="../../../utils/utils.js"></script>
    <script src="../../../config/config.js"></script>
    <script src="../../../utils/mixins.js"></script>
    <script src="../../../yl/vue.js"></script>
    <script src="../../../yl/index.js"></script>
    <script src="../../../yl/zh-cn.mjs"></script>
    <script src="../../../yl/index.iife.min.js"></script>
    <script src="../../../yl/jquery.min.js"></script>
    <script src="../../../utils/jquery.cookie.js"></script>
    <script src="../../../api/request.js"></script>
    <script src="js/index.js"></script>
</body>

</html>